package CGI::FOGE2::Msg;
use CGI::FOGE2::Msg_fr;
use CGI::FOGE2::Msg_en;
use CGI::FOGE2::Msg_ja;

# Abstract class.
sub AUTOLOAD {
    my $self = shift;
    my $msg = $AUTOLOAD;

    $msg =~ s/^.*\:\:([^:]+)$/$1/; # "CGI::FOGE2::Msg::greet" -> "greet"

    # don't error out when DESTROY is called
    if ($msg =~ /^[A-Z]+$/)  {
	return;
    }

    $longmsg = $self->{$msg};
    if (defined $longmsg) {
	return $longmsg;
    } else {
	CGI::Carp::croak(sprintf "No such message `%s'\n", $msg);
    }
}

1;
